public class RecursiveSum {
    public static int Sum(int n) {
        if (n == 1) {
            return 1;
        }
        return n + Sum(n-1);
    }

    public static void main(String[] args) {
        int ret = Sum(4);
        System.out.println(ret);
    }
}
